#include<bits/stdc++.h>
using namespace std;

int a[105];

signed main() {
    int n;
    cin >> n;

    for(int i = 0; i <= n; i++)
        cin >> a[i];

    bool beginFlag = 0;
    for(int i = 0; i <= n; i++) {
        if(!a[i]) continue;

        if(a[i] < 0)
            cout << "-";
        if(a[i] > 0 && beginFlag)
            cout << "+";

        beginFlag = 1;

        if(abs(a[i]) == 1 && i == n || abs(a[i]) != 1)
            cout << abs(a[i]);
        if(n - i > 1)
            cout << "x^" << n - i;
        else if(n - i == 1)
            cout << "x";
    }

    return 0;
}

